package com.monitoring.application.dto;

import lombok.Data;
import java.time.LocalDateTime;

@Data
public class EnvironmentalDataDTO {
    private Long id;
    private Long sensorId;
    private String sensorName;
    private String location;
    private double temperatureValue;
    private double humidityValue;
    private double energyValue;
    private LocalDateTime timestamp;
    private String dataType;
    
    // 用于创建新的环境数据记录
    public static EnvironmentalDataDTO createData(Long sensorId, double temperature,
                                                double humidity, double energy, String dataType) {
        EnvironmentalDataDTO dto = new EnvironmentalDataDTO();
        dto.setSensorId(sensorId);
        dto.setTemperatureValue(temperature);
        dto.setHumidityValue(humidity);
        dto.setEnergyValue(energy);
        dto.setDataType(dataType);
        return dto;
    }
}